/**
 * Licensee: DuKe TeAm
 * License Type: Purchased
 */
package ormsamples;

import org.orm.*;
public class DeleteAutentificacionData {
	public void deleteTestData() throws PersistentException {
		PersistentTransaction t = orm.AutentificacionPersistentManager.instance().getSession().beginTransaction();
		try {
			orm.DAOFactory lDAOFactory = orm.DAOFactory.getDAOFactory();
			orm.dao.UsuarioDAO lormUsuarioDAO = lDAOFactory.getUsuarioDAO();
			orm.Usuario lormUsuario = lormUsuarioDAO.loadUsuarioByQuery(null, null);
			// Delete the persistent object
			lormUsuarioDAO.delete(lormUsuario);
			t.commit();
		}
		catch (Exception e) {
			t.rollback();
		}
		
	}
	
	public static void main(String[] args) {
		try {
			DeleteAutentificacionData deleteAutentificacionData = new DeleteAutentificacionData();
			try {
				deleteAutentificacionData.deleteTestData();
			}
			finally {
				orm.AutentificacionPersistentManager.instance().disposePersistentManager();
			}
		}
		catch (Exception e) {
			e.printStackTrace();
		}
	}
}
